PROJECT(TestCurl)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
IF(NOT CMAKE_BUILD_TYPE)
	SET(CMAKE_BUILD_TYPE Debug)
ENDIF(NOT CMAKE_BUILD_TYPE)
CMAKE_POLICY( SET CMP0002 OLD)
IF(CMAKE_BUILD_TYPE STREQUAL Debug)
	ADD_DEFINITIONS(-D_DEBUG)
	SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/../../product/linuxd)
	LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/../../product/linuxd)
ELSE(CMAKE_BUILD_TYPE STREQUAL Debug)
	ADD_DEFINITIONS(-DNDEBUG)
	SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/../../product/linux)
	LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/../../product/linux)
ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)

SET(CMAKE_C_FLAGS_DEBUG "-g -W -O0 -lrt")
SET(CMAKE_CXX_FLAGS_DEBUG "-g -W -O0 -lrt")
SET(CMAKE_C_FLAGS_RELEASE "-g -W -O2 -lrt")
SET(CMAKE_CXX_FLAGS_RELEASE "-g -W -O2 -lrt")

ADD_DEFINITIONS(-std=c++0x)

INCLUDE_DIRECTORIES(
	.
)

FILE(GLOB_RECURSE CPP_LIST "*.cpp")
FOREACH(cpp ${CPP_LIST})
	ADD_EXECUTABLE(TestCurl ${cpp})
ENDFOREACH(cpp)

TARGET_LINK_LIBRARIES(TestCurl cdecegg cdeccore dl iconv curl)
